package com.shun.controller.api

import com.shun.entity.User
import com.shun.service.TaskServerService
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.*

/**
 * Created by rainbow on 2017/9/19.
 *一事专注，便是动人；一生坚守，便是深邃！
 */
@RestController
@RequestMapping("/api/v1/taskServer")
class TaskServerController {
    @Autowired
    private lateinit var taskServerService: TaskServerService


    @PostMapping("/create")
    fun create(@RequestBody params: Map<String, String>, @SessionAttribute("user") user: User) = taskServerService.create(params, user)

    @GetMapping("/list")
    fun list(@RequestParam params: Map<String, String>) = taskServerService.list(params)
}